package com.educate.controller;


import com.educate.common.api.Result;
import com.educate.common.dto.MenuNavDto;
import com.educate.service.MenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author yjj
 * @date 2021/11/17
 * @description:  菜单Controller
 */
@Api(tags = "菜单相关接口")
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    /**
     * 获取导航栏信息
     * @return List<MenuNavDto>
     */
    @ApiOperation("获取首页导航栏")
    @GetMapping("/nav")
    public Result getNavList(){
        List<MenuNavDto> navList = menuService.getNavList();
        return Result.success(navList);
    }
}
